
import mhv.fr.sprite.Sprite;
import mhv.fr.sprite.controller.SpriteController;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Marc-Henri
 */
public class BulletController extends SpriteController {

    final int SPRITE_SHIP = 1;
    final int SPRITE_BULLET = 2;
    final int SPRITE_MUSHROOM_NORMAL = 10;
    final int SPRITE_MUSHROOM_HIT_1 = 11;
    final int SPRITE_MUSHROOM_HIT_2 = 12;
    final int SPRITE_CENTIPEDE_HEAD = 20;
    final int SPRITE_CENTIPEDE_BODY = 21;
    final int SPRITE_SPIDER = 30;

    @Override
    public void move() {
        getGameEntity().updateMove();

        if (getGameEntity().getY() < 0) {
            getGameEntity().setAlive(false);
        }
    }

    @Override
    public void doCollide(Sprite sp) {
        switch (sp.getType()) {
            case SPRITE_SPIDER:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(20);
                break;

            case SPRITE_CENTIPEDE_HEAD:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(10);
                break;

            case SPRITE_CENTIPEDE_BODY:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(20);
                break;

            case SPRITE_MUSHROOM_NORMAL:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(1);
                break;

            case SPRITE_MUSHROOM_HIT_1:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(1);
                break;

            case SPRITE_MUSHROOM_HIT_2:
                getGameEntity().setAlive(false);
                GameManager.getInstance().incScore(2);
                break;

            default:
                break;

        }
    }

    public BulletController() {
    }
}
